
Ext.define('Holo.model.App', {
    extend: 'Ext.data.Model',
    idProperty: 'id',
		
    fields: [
        {
            name: 'id',
            type: 'int'
        },
        {
            name: 'language',
            type: 'string'
        },
        {
            name: 'name',
            type: 'string'
        },

        {
            name: 'type',
            type: 'string'
        },
        {
            name: 'status',
            type: 'string'
        },
        {
            name: 'about_us',
            type: 'string'
        },
        {
            name: 'title',
            type: 'string'
        },
        {
            name: 'text',
            type: 'string'
        },
        {
            name: 'store_url_apple',
            type: 'string'
        },
        {
            name: 'store_url_google',
            type: 'string'
        },
        {
            name: 'store_url_windows',
            type: 'string'
        },
        {
            name: 'store_url_blackberry',
            type: 'string'
        },
        {
            name: 'user_id',
            type: 'int'
        }
    ],
    
     associations: [{
                type: 'belongsTo',
                model: 'Holo.model.User',
                foreignKey:'user_id'
            }],
    

    proxy: {
        type: 'ajax',
        api: {
            create: 'database/controller.php?MODEL=app&ACTION=ADD',
            read: 'database/controller.php?MODEL=app&ACTION=LST',
            update: 'database/controller.php?MODEL=app&ACTION=UPD',
            destroy: 'database/controller.php?MODEL=app&ACTION=DEL'
        },
        reader: {
            type: 'json',
            root: 'data'
        },
         writer : {
            type: 'json',
        	allowSingle  : false,
        	root: 'data',
        	encode : true
        }

        
        
    }
});